home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / documents / ELF / README < prev    next >
Encoding:
Text File  |  1996-11-11  |  7.7 KB  |  167 lines

  1.  
  2.              ELF (Executable and Linking Format) documentation
  3.  
  4. ----------------------------------------------------------------------------
  5.  
  6.                This is a collection of information about ELF,
  7.                      the Executable and Linking Format
  8.                        employed in IRIX 5 and beyond.
  9.  
  10. Executable and Linking Format
  11.  
  12. Previous versions of IRIX used an extended version of the Common Object File
  13. Format (COFF) for object files. The current compiler system produces ELF
  14. object files. ELF is the format specified by the System V Release 4
  15. Applications Binary Interface (the SVR4 ABI). In addition, ELF provides
  16. support for Dynamic Shared Objects, described below. Types of ELF object
  17. files include:
  18.  
  19.    * Relocatable files contain code and data in a format suitable for
  20.      linking with other object files to make a shared object or executable.
  21.    * Dynamic Shared Objects contain code and data suitable for dynamic
  22.      linking. Relocatable files may be linked with DSOs to create a dynamic
  23.      executable. At run time, the run-time linker combines the executable
  24.      and DSOs to produce a process image.
  25.    * Executable files are programs ready for execution. They may or may not
  26.      be dynamically linked.
  27.  
  28. COFF executables continue to run on releases of IRIX prior to IRIX 6, but
  29. the current compiler system has no facility for creating or linking COFF
  30. executables. COFF and ELF object files may not be linked together. To take
  31. advantage of new IRIX features, you must recompile your code.
  32.  
  33. IRIX executes all binaries that are compliant with the SVR4 ABI, as
  34. specified in the System V Applications Binary Interface - Revised Edition
  35. and the System V ABI MIPS Processor Supplement. However, binaries compiled
  36. under this version of the compiler system are not guaranteed to comply with
  37. the SVR4 ABI. The MIPS-specific version of the SVR4 ABI is referred to as
  38. the MIPS ABI. Programs that comply with the MIPS ABI can be run on any
  39. machine that supports the MIPS ABI.
  40.  
  41.      Lifted from Executable and Linking Format, in Chapter 2: Using the
  42.      MIPSpro Compiler System -- with the exception of the bolded words in
  43.      the paragraph beginning with "COFF executabales": the on-board version
  44.      of the MIPSpro(TM) Compiling and Performance Tuning Guide is
  45.      out-of-date with respect to statments like COFF executables continue to
  46.      run on new releases of IRIX -- this is not the case once one moves to
  47.      any flavor of IRIX 6. See The Coff Story -- End of Coff Support and
  48.      Preparing to Upgrade to IRIX 6.2 for more on the move from Coff to ELF
  49.      that is incumbent on anyone who upgrades to an IRIX 6-based O.S. level.
  50.  
  51.    * elspec.html: Controlling a Program's Layout with ELSPEC, November, 1995
  52.         o addr1.f
  53.         o eladdr1
  54.         o compact1.c
  55.         o elcompact1
  56.         o sproc1.c
  57.         o elsproc1
  58.  
  59. Using apropos(1) (with the argument of "elf"), the man pages included below
  60. were fished out of the IRIX 6.2 doc sea.
  61.  
  62.    * dso(5) DSO - Dynamic Shared Object
  63.      TOPIC
  64.           This man page is intended to be both a quick reference and a
  65.           source of detailed information on Dynamic Shared Objects. It is
  66.           divided into 4 sections:
  67.                General Information and Overview
  68.                Linking/Building Suggestions
  69.                Performance Considerations
  70.                Frequently Asked Questions and Detailed Discussions
  71.      GENERAL INFORMATION AND OVERVIEW
  72.           Format
  73.                A DSO, or Dynamic Shared Object, is an ELF format object
  74.                file, very similar in structure to an executable program but
  75.                with no "main". It has a shared component, consisting of
  76.                shared text and read-only data; a private component,
  77.                consisting of data and the GOT (Global Offset Table); several
  78.                sections that hold information necessary to load and link the
  79.                object; and a liblist, the list of other shared objects
  80.                referenced by this object. Most of the libraries supplied by
  81.                SGI are available as dynamic shared objects.
  82.           PIC -- Position Independent Code
  83.                A DSO is relocatable at runtime; it can be loaded at any
  84.                virtual address. A consequence of this is that all references
  85.                to external symbols must be resolved at runtime. References
  86.                from the private region (.e.g. from private data) are
  87.                resolved once at load-time; references from the shared region
  88.                (e.g. from shared text) must go through an indirection table
  89.                (GOT) and hence have a small performance penalty associated
  90.                with them.
  91.                Code compiled for use in a shared object is referred to as
  92.                PIC whereas non-PIC is usually referred to as non-shared.
  93.                Non-shared code and PIC can not be mixed in the same object.
  94.           What Happens at Runtime?
  95.                Exec loads the main program and then loads rld(1), the
  96.                runtime linking loader, which finishes the exec operation.
  97.                Starting with main's liblist, rld loads each shared object on
  98.                the list that is not marked as delay load, reads that
  99.                object's liblist, and repeats the operation until all shared
  100.                objects have been loaded. Next, rld allocates common and
  101.                fixes up symbolic references in each loaded object. (This is
  102.                necessary because we don't know until runtime where the
  103.                object will be loaded.) Next, each object's init code is
  104.                executed. Finally, control is transferred to "__start".
  105.                Be sure to read about quickstart, delayed loads, sgidladd(3),
  106.                and dlopen(3) as each can affect this general process.
  107.  
  108.    * elf(4) - Executable and Linking Format (ELF) files
  109.           The file name a.out is the default ELF-format output file name
  110.           from the link editor ld(1). The link editor will make an a.out
  111.           executable if there were no errors and no unresolved external
  112.           references.
  113.           Programs that manipulate ELF files may use the library described
  114.           in elf(3E). An overview of the file format follows. For more
  115.           complete information, see the references given below.
  116.  
  117.    * elfdump(5) -- dumps selected parts of a 32-bit or a 64-bit ELF object
  118.      file/archive and displays them in ELF style
  119.  
  120.    * elspec(5) -- ELF Layout specification
  121.           TOPIC
  122.                This manpage describes the ELF Layout Specification language
  123.                implemented by ld(1) which allows users to exactly specify
  124.                layout of object files, programs, and shared objects.
  125.           INTRODUCTION
  126.                It is often desirable to specify the exact layout of an
  127.                executable file. Some of the uses of this might be embedded
  128.                systems, thread-local data layout, reducing cache conflicts,
  129.                reducing false sharing, reducing memory utilization. The
  130.                current linker allows exact specifcation of layout via the
  131.                ELF Layout Specification language.
  132.  
  133.    * ld(1)
  134.    * rqsall(1)
  135.    * rqsprint(1)
  136.    * rqsread(1)
  137.  
  138.    * dwarfdump
  139.  
  140.    * elf(3E)
  141.    * elf_begin(3E)
  142.    * elf_cntl(3E)
  143.    * elf_end(3E)
  144.    * elf_error(3E)
  145.    * elf_fill(3E)
  146.    * elf_flag(3E)
  147.    * elf_fsize(3E)
  148.    * elf_getarhdr(3E)
  149.    * elf_getarsym(3E)
  150.    * elf_getbase(3E)
  151.    * elf_getdata(3E)
  152.    * elf_getehdr(3E)
  153.    * elf_getident(3E)
  154.    * elf_getphdr(3E)
  155.    * elf_getshdr(3E)
  156.    * elf_hash(3E)
  157.    * elf_kind(3E)
  158.    * elf_next(3E)
  159.    * elf_rawfile(3E)
  160.    * elf_strptr(3E)
  161.    * elf_update(3E)
  162.    * elf_version(3E)
  163.    * elf_xlate(3E)
  164.  
  165. ----------------------------------------------------------------------------
  166. Copyright ⌐ 1995-96, Silicon Graphics, Inc.
  167.